package com.lottery.material.entity.portaluser;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.lottery.material.entity.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Description：前端用户信息表
 * Created by 朱正磊 on 2019-04-03 11:23
 */
@Entity
@Data
@EqualsAndHashCode(callSuper = false)
@Table(name = "material_portal_user_info")//前端用户信息表
public class PortalUserInfo extends BaseEntity {

    private static final long serialVersionUID = 6015647882357115164L;

    @Column(columnDefinition = "varchar(50) not null comment '用户id'")
    private String userId;

    @Column(columnDefinition = "varchar(50) not null comment '访问令牌'")
    private String accessToken;

    @Column(columnDefinition = "varchar(20) not null comment '登录手机号'")
    private String loginPhoneNumber;

    @Column(columnDefinition = "varchar(32) comment '登录密码'")
    private String loginPassword;

    @Column(columnDefinition = "varchar(100) comment '头像url'")
    private String headPortraitUrl;

    @Column(columnDefinition = "varchar(20) comment '昵称'")
    private String nickName;

    @Column(columnDefinition = "int(1) default '1' comment '昵称是否被修改过（1：未修改；2：修改过）'")
    private Integer isUpdateNickName;

    @Column(columnDefinition = "varchar(50) comment '个性签名'")
    private String signature;

    @Column(columnDefinition = "decimal(19,2) default '0' comment '金币--充值'")
    private BigDecimal goldBuy;

    @Column(columnDefinition = "decimal(19,2) default '0' comment '金币--收益'")
    private BigDecimal goldProfit;

    @Column(columnDefinition = "decimal(19,2) default '0' comment '金币--冻结'")
    private BigDecimal goldFreeze;

    @Column(columnDefinition = "decimal(19,2) default '0' comment '金币--已结算收益'")
    private BigDecimal goldAlreadyProfit;

    @Column(columnDefinition = "int(1) default '1' comment '是否认证用户（1：未认证；2：已认证）'")
    private Integer isAuth;

    @Column(columnDefinition = "int(1) default '1' comment '是否达人（1：否；2：是）'")
    private Integer isExpert;

    @Column(columnDefinition = "int(1) default '1' comment '用户状态（1：正常；2：永久封禁；3：已删除）'")
    private Integer userStatus;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(columnDefinition = "datetime comment '最近一次登录时间'")
    private Date lastLoginTime;

    @Column(columnDefinition = "int(11) default '0' comment '关注数'")
    private Integer followTotal;

    @Column(columnDefinition = "int(11) default '0' comment '粉丝数'")
    private Integer fansTotal;

    @Column(columnDefinition = "int(11) default '0' comment '发布文章数'")
    private Integer publishTotal;

    @Column(columnDefinition = "varchar(20) comment '真实姓名'")
    private String realName;

    @Column(columnDefinition = "varchar(50) comment '身份证号'")
    private String idNumber;

    @Column(columnDefinition = "varchar(20) comment '换绑银行卡验证密码'")
    private String bankCardCheckPassword;

    @Column(columnDefinition = "varchar(20) comment '银行卡卡号'")
    private String bankCardNumber;

    @Column(columnDefinition = "varchar(10) comment '开户银行编号（对应material_bank_dict表中bank_code）'")
    private String bankCode;

    @Column(columnDefinition = "varchar(20) comment '银行预留手机号'")
    private String bankPhoneNumber;

    @Column(columnDefinition = "int(11) comment '用户等级'")
    private Integer userLevel;

    @Column(columnDefinition = "int(1) default '1' comment '注册方式（1：前台正常流程注册；2：后台运营人员注册）'")
    private Integer logonMode;

//    @Column(columnDefinition = "varchar(8) default '' comment '盐值加密的盐值'")
//    private String salt;

}
